/*
 This program is submitted as part of an assignment in the
 J2E
 Fall Semester 2010-2011 
 School of Computer Science
 Interdisciplinary Center, Hertzelia, Israel 

 http://www.idc.ac.il 

 Exercise No.         : 3
 File Name            : TaskResult.java
 Names (First Last)   : Itay Sorani, Nadav Ziv, Yonathan Zarsky
 Student No.          : 066530254, 039937883, 039692918

 */
package com.example;
import com.example.util.GameModel;

/**
 * Encapsulates the result of the processing of a user request to perform a certain action in the game.
 * such as move or create figure.
 */
public class TaskResult {

    // The updated model following the processing of the request
    private GameModel model;

    // If not null, indicates an error message corresponding to a failure in carrying out the request
    private String errorMessage;
    private int playerPoints;
    private int playerHitPoints;
    private int enemyHitPoints;
    private String messageToDisplay;
    private boolean isCanvasMoving;
    private float xCanvasMoveDestination;
    private float yCanvasMoveDestination;
    
    /**
     * Constructs a MoveResult
     */
    public TaskResult() {
    }

    /**
     * Checks if the processing of the request was successful
     */
    public boolean isSuccess() {
        return errorMessage == null;
    }

    /**
     * Returns the model resulting from processing the request
     */
    public GameModel getModel() {
        return model;
    }

    /**
     * Sets the model resulting from the processing of the request
     */
    public void setModel(GameModel model) {
        this.model = model;
    }

    /**
     * Returns an error message that corresponds to a failure in processing the request, or null if the
     * processing was successful
     */
    public String getErrorMessage() {
        return errorMessage;
    }

    /**
     * Sets an error message indicating a failure in processing the request
     */
    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

	public void setPlayerHitPoints(int playerHitPoints) {
		this.playerHitPoints = playerHitPoints;
	}

	public int getPlayerHitPoints() {
		return playerHitPoints;
	}

	public void setEnemyHitPoints(int enemyHitPoints) {
		this.enemyHitPoints = enemyHitPoints;
	}

	public int getEnemyHitPoints() {
		return enemyHitPoints;
	}

	public void setPlayerPoints(int playerPoints) {
		this.playerPoints = playerPoints;
	}

	public int getPlayerPoints() {
		return playerPoints;
	}

	public void setMessageToDisplay(String messageToDisplay) {
		this.messageToDisplay = messageToDisplay;
	}

	public String getMessageToDisplay() {
		return messageToDisplay;
	}

	public void setCanvasMoving(boolean isCanvasMoving) {
		this.isCanvasMoving = isCanvasMoving;
	}

	public boolean isCanvasMoving() {
		return isCanvasMoving;
	}

	public void setxCanvasMoveDestination(float xCanvasMoveDestination) {
		this.xCanvasMoveDestination = xCanvasMoveDestination;
	}

	public float getxCanvasMoveDestination() {
		return xCanvasMoveDestination;
	}

	public void setyCanvasMoveDestination(float yCanvasMoveDestination) {
		this.yCanvasMoveDestination = yCanvasMoveDestination;
	}

	public float getyCanvasMoveDestination() {
		return yCanvasMoveDestination;
	}
}
